package com.my.batis.ctrl;

import java.util.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestCtrl {

	@RequestMapping("/hello")
	public String test(HttpServletRequest request, 
			HttpServletResponse response){
		String simple_string_username = "gaohongyan";  
        request.setAttribute("simple_string_username", 
        		simple_string_username);
        List<User> list = new ArrayList<User>();
        for(int i=0;i<2;i++){
        	Map<String,Object> map = new HashMap<String,Object>();
        	User user = new User();
        	user.setName("hzb"+i);
//        	map.put("name", "hzb"+i);
        	list.add(user);
        }
        request.setAttribute("list", list);
		return "hello";
	}
}
